const rules = require("./webpack.rules");
const plugins = require("./webpack.plugins");

rules.push(
  {
    test: /\.css$/,
    use: [
      { loader: "vue-style-loader" },
      { loader: "style-loader" },
      { loader: "css-loader" },
    ],
  },
  {
    test: /\.vue$/,
    use: [{ loader: "vue-loader" }],
  },
  {
    test: /\.(jpg|png|jpeg|gif)$/,
    use: [
      {
        loader: "url-loader",
        options: {
          limit: 10240,
          fallback: {
            loader: 'file-loader',
            options: {
              name: 'img/[name].[contenthash:8].[ext]',
              esModule: false
            }
          },
          esModule: false
        }
      }],
  }
);

module.exports = {
  module: {
    rules,
  },
  plugins: plugins,
  resolve: {
    extensions: [".js", ".ts", ".jsx", ".tsx", ".css", ".vue"],
  },
};
